home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Directorty Opus 5 - Magellan 2
/
Opus 5 - Magellan 2.iso
/
DOpus_SDK_5.5
/
amigaguide
/
dopus
/
lists.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-09-07
|
4KB
|
109 lines
@DATABASE "dopus/lists.h"
@MASTER "opussdk:include/dopus/lists.h"
@REMARK (c) Dr Greg Perry and Jonathan Potter, GPSoftware 1996
@REMARK This file was initially created by ADtoHT 2.1 on 07-Sep-96 18:20:14
@REMARK ADtoHT is © 1993-1995 Christian Stieber
@NODE MAIN "dopus/lists.h"
@TOC "DopusSDK/MAIN"
@{"dopus/lists.h" LINK File}
@{b}Structures@{ub}
@{"_Att_List" LINK "dopus/lists.h/File" 10} @{"_Att_Node" LINK "dopus/lists.h/File" 22} @{"ListLock" LINK "dopus/lists.h/File" 63}
@{b}Typedefs@{ub}
@{"Att_List" LINK "dopus/lists.h/File" 10} @{"Att_Node" LINK "dopus/lists.h/File" 22}
@{b}#defines@{ub}
@{"ADDNODEF_EXCLUSIVE" LINK "dopus/lists.h/File" 30} @{"ADDNODEF_NUMSORT" LINK "dopus/lists.h/File" 31} @{"ADDNODEF_PRI" LINK "dopus/lists.h/File" 32}
@{"ADDNODEF_SORT" LINK "dopus/lists.h/File" 29} @{"LISTF_LOCK" LINK "dopus/lists.h/File" 19} @{"LISTF_POOL" LINK "dopus/lists.h/File" 20}
@{"REMLISTF_FREEDATA" LINK "dopus/lists.h/File" 34} @{"REMLISTF_SAVELIST" LINK "dopus/lists.h/File" 35} @{"SEMF_ATTEMPT" LINK "dopus/lists.h/File" 70}
@{"SEMF_EXCLUSIVE" LINK "dopus/lists.h/File" 69} @{"SEMF_SHARED" LINK "dopus/lists.h/File" 68}
@ENDNODE
@NODE File "dopus/lists.h"
#ifndef _DOPUS_LISTS
#define _DOPUS_LISTS
/*****************************************************************************
List management
*****************************************************************************/
typedef struct _Att_List
{
struct List list; // List structure
struct SignalSemaphore lock; // Semaphore for locking
ULONG flags; // Flags
APTR memory; // Memory pool
@{"struct _Att_Node" LINK File 22} *current; // Current node (application use)
} Att_List;
#define LISTF_LOCK (1<<0) // List requires locking
#define LISTF_POOL (1<<1) // Use memory pooling
typedef struct _Att_Node
{
struct Node node; // Node structure
@{"Att_List" LINK File 10} *list; // Pointer back to list
ULONG data; // User data
} Att_Node;
#define ADDNODEF_SORT 1 // Sort names
#define ADDNODEF_EXCLUSIVE 2 // Exclusive entry
#define ADDNODEF_NUMSORT 4 // Numerical name sort
#define ADDNODEF_PRI 8 // Priority insertion
#define REMLISTF_FREEDATA 1 // FreeVec data when freeing list
#define REMLISTF_SAVELIST 2 // Don't free list itself
void AddSorted(struct List *,struct Node node);
void Att_ChangeNodeName(@{"Att_Node" LINK File 22} *,char *);
@{"Att_Node" LINK File 22} *Att_FindNode(@{"Att_List" LINK File 10} *,long);
@{"Att_Node" LINK File 22} *Att_FindNodeData(@{"Att_List" LINK File 10} *,ULONG);
long Att_FindNodeNumber(@{"Att_List" LINK File 10} *,@{"Att_Node" LINK File 22} *);
@{"Att_List" LINK File 10} *Att_NewList(ULONG);
@{"Att_Node" LINK File 22} *Att_NewNode(@{"Att_List" LINK File 10} *,char *,ULONG,ULONG);
long Att_NodeCount(@{"Att_List" LINK File 10} *);
long Att_NodeDataNumber(@{"Att_List" LINK File 10} *,ULONG);
char *Att_NodeName(@{"Att_List" LINK File 10} *,long);
long Att_NodeNumber(@{"Att_List" LINK File 10} *,char *);
void Att_PosNode(@{"Att_List" LINK File 10} *,@{"Att_Node" LINK File 22} *,@{"Att_Node" LINK File 22} *);
void Att_RemList(@{"Att_List" LINK File 10} *,long);
void Att_RemNode(@{"Att_Node" LINK File 22} *);
struct Node *FindNameI(struct List *,char *);
void LockAttList(@{"Att_List" LINK File 10} *,BOOL);
void SwapListNodes(struct List *,struct Node *,struct Node *);
void UnlockAttList(@{"Att_List" LINK File 10} *);
/*****************************************************************************
Semaphore management
*****************************************************************************/
struct ListLock {
struct List list;
struct SignalSemaphore lock;
};
#define SEMF_SHARED 0
#define SEMF_EXCLUSIVE (1<<0)
#define SEMF_ATTEMPT (1<<1)
long GetSemaphore(struct SignalSemaphore *,long,APTR);
void InitListLock(@{"struct ListLock" LINK File 63} *,APTR);
BOOL IsListLockEmpty(@{"struct ListLock" LINK File 63} *);
#endif
@ENDNODE